Ext.define('Contact', {
    extend: 'Ext.data.Model',
    config: {
        fields:['groupField','name','image']
    }
});

Ext.create('Ext.data.Store', {
    extend: 'Ext.Container',
    id:'ListStore',
    model:'Contact',
    sorters:'groupField',
    grouper: {
         groupFn: function(record) {
				 return record.groupField;
         },
 		sortProperty: 'groupField'
    },
    groupField:'groupField',
    data:[
        {id:'updateAccount',name:'修改账户密码',groupField:'1',image:'lib/customimg/Bluetooth@2x.png', content:''},
        {id:'deleteAccount',name:'删除账户资料',groupField:'1',image:'lib/customimg/Carrier@2x.png', content:''},
        {id:'changeAccount',name:'切换账户',groupField:'1',image:'lib/customimg/dnd@2x.png', content:''},
        {id:'logoutAccount',name:'注销账户',groupField:'1',image:'lib/customimg/WiFi@2x.png', content:''},
        {id:'exit',name:'退出软件',groupField:'2',image:'lib/customimg/Wallpaper@2x.png', content:''},
        {id:'about',name:'关于软件',groupField:'2',image:'lib/customimg/Settings-Sound@2x.png', content:''}
    
    ]
});


Ext.define('DDMS.view.SettingLeft', {
    extend: 'Ext.form.Panel',

    config: {
    	layout:'fit',
        cls:'demo-list',
        items:[
	        {
	        	xtype:'list',
	        	id:'settingLeft',
	        	height:480,
	        	ui:'round',
	        	grouped:true,
	        	pinHeaders:false,
	        	store:'ListStore',
	        	scrollable: false,
	        	itemTpl: [
            	'<table width="100%" height="100%">'+
            		'<tr height="30">'+
            			'<td width="30" style="font-size:17pt;">'+
            				'<img src="{image}" height="30" width="30">'+
            			'</td>'+
            			'<td width="*%" style="font-size:15pt;">'+
            				'&nbsp;&nbsp;{name}'+
            			'</td>'+
            		'</tr>'+
            	'</table>'
        		]
	        }
        ]
    }
});
